import {
  request,
  METHOD
} from '@/utils/request'
// import axios from 'axios'

// import Cookie from 'js-cookie'
const BASE_URL = process.env.VUE_APP_API_URL

/**
/*
用户消息列表
*/
export async function userMessageList (params) {
  return request(`${BASE_URL}/message/admin/userMessage`, METHOD.GET, params)
}
// 解绑根据ID查看
export async function vehicleUnbindOrdersGet (id) {
  return request(`${BASE_URL}/todo/admin/vehicleUnbindOrders/${id}`, METHOD.GET)
}
// 解绑根据ID查看
export async function vehicleSchedulingOrdersGet (id) {
  return request(`${BASE_URL}/todo/admin/vehicleSchedulingOrders/${id}`, METHOD.GET)
}
// 解绑审核记录分页查询
export async function vehicleUnbindOrdersList (params) {
  return request(`${BASE_URL}/todo/admin/vehicleUnbindOrders`, METHOD.GET, params)
}
// 分页查询骑手手机号获取记录表
export async function mobileLogList (params) {
  return request(`${BASE_URL}/member/admin/mobileLog`, METHOD.GET, params)
}
// 维修工单列表分页查
export async function repairOrdersList (params) {
  return request(`${BASE_URL}/todo/admin/repairOrders`, METHOD.GET, params)
}
// 分页查询车辆信息更改记录-列表
export async function ordersChangeList (params) {
  return request(`${BASE_URL}/business/admin/vehicle/change/list`, METHOD.GET, params)
}
// 维修点全部查询
export async function repairAll () {
  return request(`${BASE_URL}/business/admin/stores/all/repair`, METHOD.GET)
}

// 用户用车详情
export async function vehiclesDetail (id) {
  return request(`${BASE_URL}/business/admin/vehicleMember/info/${id}`, METHOD.GET)
}
// 维修工单详情
export async function repairOrdersDetail (id) {
  return request(`${BASE_URL}/todo/admin/repairOrders/${id}`, METHOD.GET)
}
// 锁车记录
export async function lockList (params) {
  return request(`${BASE_URL}/business/admin/vehicleLock`, METHOD.GET, params)
}
// 备注记录
export async function maskList (params) {
  return request(`${BASE_URL}/business/admin/vehicleRemark`, METHOD.GET, params)
}
export async function vehicleLabelGet (vehicleId) {
  return request(`${BASE_URL}/business/admin/vehicleLabel/${vehicleId}`, METHOD.GET)
}
// 新增备注
export async function vehicleRemark (params) {
  return request(`${BASE_URL}/business/admin/vehicleRemark`, METHOD.POST, params)
}
// 商户新增备注
export async function merchantVehicleRemark (params) {
  return request(`${BASE_URL}/business/admin/vehicleRemark/merchant`, METHOD.POST, params)
}
// 车辆详情-车辆备注-新增车辆备注-上传照片
export function uploadVehicleRemark () {
  return `${BASE_URL}/business/admin/vehicleRemark/uploadImage`
}

export async function lockStoreList (params) {
  return request(`${BASE_URL}/business/admin/vehicleLock`, METHOD.GET, params)
}

// 解锁车辆
export async function unlock (params) {
  return request(`${BASE_URL}/business/admin/vehicleLock/unlock`, METHOD.POST, params)
}

// 车辆信息照图片上传
export function vehiclesUpload () {
  return `${BASE_URL}/business/admin/vehicles/upload`
}
// 上传配件图（一张
export function repairsUpload () {
  return `${BASE_URL}/business/admin/accessories/uploadAccessoriesImage`
}

export async function vehiclesUploads (data) {
  return request(`${BASE_URL}/business/admin/vehicles/upload`, METHOD.POST, data)
}
// 车库新增
export async function vehiclesAdd (data) {
  return request(`${BASE_URL}/business/admin/vehicles`, METHOD.POST, data)
}
// 车型新增
export async function modelsAdd (data) {
  return request(`${BASE_URL}/business/admin/vehicleModels`, METHOD.POST, data)
}
// 入库完善
export async function perfectAdd (data) {
  return request(`${BASE_URL}/business/admin/putInStorageVehicleInfo/perfect`, METHOD.POST, data)
}
// 车辆编辑
export async function vehiclesEdit (id, data) {
  return request(`${BASE_URL}/business/admin/vehicles/${id}`, METHOD.PUT, data)
}
// 品牌编辑
export async function modelsEdit (id, data) {
  return request(`${BASE_URL}/business/admin/vehicleModels/${id}`, METHOD.PUT, data)
}
// 根据车辆ID查询当前车辆的门店和供应商信息
export async function vehicleMemberDetail (vehicleId) {
  return request(`${BASE_URL}/business/admin/vehicles/${vehicleId}`, METHOD.GET)
}
// 品牌详情
export async function modelDetail (id) {
  return request(`${BASE_URL}/business/admin/vehicleModels/${id}`, METHOD.GET)
}
// 根据车辆ID查询当前车辆的门店和供应商信息
export async function putInStorageVehicleInfoDetail (vehicleId) {
  return request(`${BASE_URL}/business/admin/putInStorageVehicleInfo/${vehicleId}`, METHOD.GET)
}
// 实时消息查询
export async function realTime () {
  return request(`${BASE_URL}/message/admin/userMessage/realTime`, METHOD.GET)
}

// 1.6.5 自有车辆 车损记录列表
export async function carLoss (params) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/findDamageRecord`, METHOD.GET, params)
}
